import { Component, OnInit, Input, Injector } from '@angular/core';
import { HttpClient, HttpRequest, HttpResponse } from "@angular/common/http";
import { BehaviorSubject ,  Observable } from 'rxjs';
import { debounceTime ,  map ,  switchMap ,  filter } from 'rxjs/operators';
import { ActivatedRoute, NavigationExtras } from '@angular/router';
import { NzMessageService, NzModalRef, NzModalService, UploadFile } from 'ng-zorro-antd';
import { importExpr } from '@angular/compiler/src/output/output_ast';
import { environment } from 'environments/environment';
import {
  PagedResultDto, ClassInfoOutput, PagerSearchInput, HttpService, BaseComponentConfig,
  CustomNavigation, KeyValueOutput, SearchValue
} from '../../..';
import { NgZorroPageBaseComponent } from '../../../core/ng-zorro-page-base-component/ng-zorro-page-base-component.component';
import { StudentJoinCourseOutput } from '../../../core/model/StudentJoinCourseDto';
import { isNumber } from 'util';

@Component({
  selector: 'app-mark-inquiry-student',
  templateUrl: './mark-inquiry-student.component.html',
  styleUrls: ['../../../core/ng-zorro-page-base-component/ng-zorro-page-base-component.component.scss']
})
export class MarkInquiryStudentComponent implements OnInit {
  isLoading = false;
  courseArr = new Array();
  classArr = new Array();

  markArr;
  //
  currentPage = 1;
  pageSize = 10;
  recordTotalCount = 0;
  entities = new Array();

  markexcel;
  markexcelid = "markexcelid";
  //
  _coursePicked;
  //
  _classPicked;
  //
  constructor(injecter: Injector,
    private modal: NzModalService,
    public httpService: HttpService,
    public http: HttpClient) {
    this.inifun();
  }
  async inifun() {
    const marks = await this.httpService.get<any>("Course/GetMarksStudent?currentPage=" + this.currentPage + "&pageSize=" + this.pageSize);
    this.markArr = marks;
    this.recordTotalCount = this.markArr.recordTotalCount;
    this.currentPage = this.markArr.currentPageIndex;
    this.pageSize = this.markArr.pageSize;
    //
    this.entities = new Array();
    if (marks.entities.length !== 0) {
      this.entities = marks.entities;
    }
  }
  async getEntityListAsync(input: any) {
    this.inifun();
  }

  ngOnInit() {

  }
}
